package com.atguigu;

/**
 * @author li.chunlong lcl253-137@alibaba-inc.com
 * @desc 鸭子实现类-玩具鸭
 * @date 2021-11-01
 */
public class ToyDuck extends Duck {

    public ToyDuck() {
        flyBehavior = new NoFlyBehavior();
    }

    @Override
    public void display() {
        System.out.println("玩具鸭");
    }

    /**
     * 需要重写父类的所有方法
     */
    @Override
    public void quack() {
        System.out.println("玩具鸭不能叫~~");
    }

    @Override
    public void swim() {
        System.out.println("玩具鸭不会游泳~~");
    }
}
